<?php
    $sessao = new Zend_Session_Namespace('segmento');
?>
<h1 itemprop="name" class="titulo">
    <?php echo $this->result['PAG_TITULO']; ?>
</h1>
<div class="cnt-titulo cr_txt_pdr">
    Manual de Sobrevivência do Uniforme
    <div class="categorias_dica">
        <?php foreach($this->cat as $ct){ 
            $src = glob('public/upload/categoriadicas/'.$ct['CTD_ID'].'.*');
        ?>
        <a href="<?php echo $this->urlbase.'/dicas/index/cat/'.$ct['CTD_ID']; ?>"><img src="<?php echo $this->urlbase.'/'.$src[0]; ?>" /></a>
        <?php } ?>
    </div>
</div> 
<div class="cnt-texto">
    <div class="dicas"><?php echo $this->result['PAG_TEXTO']; ?></div>
</div> 

<ul class="lst_dicas">
    <?php 
    $cont = 0;
    foreach($this->dic as $key => $dic){ 
        $src = glob($this->dir.$dic['DIC_ID'].'.*');
        $class = '';//(($cont % 2) == 0) ? 'left':'right';
        $cont++;
        $link = strlen($dic['DIC_URLLNK']) > 1  ? $dic['DIC_URLLNK']:'javascript:void(0)'; 
        
        if($cont == 3){
            $class = 'sltl';
            $cont = 0;
        }
    ?>
    <li class="<?php echo $class; ?>">
        <a href="<?php echo $link?>" target="_blank">
        <?php if(isset($src[0])){ ?>
            <img src="<?php echo $this->urlbase.'/'.$src[0]; ?>" />
        <?php } else if(strlen($dic['DIC_IMGLNK']) > 0){ ?>
            <img src="<?php echo $dic['DIC_IMGLNK'];?>"  />
        <?php } ?>  
        </a>
        <div class="st_cima"></div>
        <div class="texto">
            <?php echo $dic['DIC_DES']; ?>
        </div>
    </li>
    <?php } 
    if($cont == 1) $style = 'cnt_fc_m';
    else if($cont == 2) $style = 'cnt_fc_p';
        
    if($cont == 1 || $cont == 2) { ?>
    <li class="<?php echo $style; ?>">
        <a href="<?php echo $sessao->CTS_FAC;?>" class="facebook<?php echo $sessao->CTS_ID?> cr_txt_pdr" target="_blank">
            Curta a nossa <i>fan page</i> e confira mais dicas.
        </a>
    </li>
    <?php  } ?>
</ul>